import request from '@/utils/request'

/**
 * 一杆一档历史缺陷
 */
export function findHistoryDefect(query) {
  return request({
    url: '/cms/jcwDefectInfo/findHistoryDefect',
    method: 'get',
    params: query
  })
}
/**
 * 一杆一档缺陷详情
 */
export function findDefectInfoById(query) {
  return request({
    url: '/cms/jcwDefectInfo/findDefectInfoById',
    method: 'get',
    params: query
  })
}
/**
 * 部门关联的线路下拉框
 */
export function line(query) {
  return request({
    url: '/cms/common/getLineListByDept',
    method: 'get',
    params: query
  })
}
/**
 * 部门关联的区间下拉框
 */
export function listByLineId(query) {
  return request({
    url: '/basic/lineSite/getSiteListByDeptOrLineId',
    method: 'get',
    params: query
  })
}
/**
 * 部门下拉框
 */
export function dept(query) {
  return request({
    url: '/sysm/share/dept/',
    method: 'get',
    params: query
  })
}
/**
 * 行别下拉框
 */
export function listDirection(query) {
  return request({
    url: '/cms/direction/getList',
    method: 'get',
    params: query
  })
}
/**
 * 获取参数异常类型列表
 */
export function getDefectTypeList() {
  return request({
    url: '/cms/analysisParamDefectNum/findAllDefectType',
    method: 'get'
  })
}
/**
 * 所有设备分类类型
 */
export function getAllJcwDevClass(query) {
  return request({
    url: '/cms/jcwDevClass/findAllJcwDevClasss',
    method: 'get',
    params: query
  })
}
/**
 * 所有设备状态
 */
export function getAllJcwDevStatus(query) {
  return request({
    url: '/cms/analysisDefectNum/devStatus',
    method: 'get',
    params: query
  })
}
/**
 * 部门下拉框
 */
export function deptTree(query) {
  return request({
    url: '/sysm/share/dept/tree/',
    method: 'get',
    params: query
  })
}

export function getListPage(query) {
  return request({
    url: '/cms/jcwUserdefectType/',
    method: 'GET',
    params: query
  })
}

export function getListAllTree(query) {
  return request({
    url: '/sysm/dept/listAllTree',
    method: 'get',
    params: query
  })
}
// 已启用  id树
export function getListTree(query) {
  return request({
    url: '/basic/jcwDevClass/listTree',
    method: 'get',
    params: query
  })
}
/**
 * 所有车间
 * @param {string} deptTypeCode 部门类型编码
 * 或车间下所有工区
 * @param {string} parentDeptCode 上级部门编码
 */
export function getWorkshopList(query) {
  return request({
    url: '/sysm/share/dept/',
    method: 'get',
    params: query
  })
}
/**
 * 所有特定缺陷类型
 * @param {string} parameterClass 参数或零部件缺陷类别
 * @param {string} devClassCode 设备种类代码
 * @param {string} statusType 设备状态代码
 * @param {string} statusCode 设备状态类型
 * @param 其余同上
 */
export function getSpecDefect(query) {
  return request({
    url: '/cms/specificDefects/specificDefects',
    method: 'get',
    params: query
  })
}
